From 17967e523e898a9627352d0a6b5e31921507ba36 Mon Sep 17 00:00:00 2001 From: "smh22@tempest.cl.cam.ac.uk" Date: Tue, 24 Feb 2004 12:06:09 +0000 Subject: [PATCH] bitkeeper revision 1.740.2.1 (403b3e314yY3Ukw__2nvEZDN9Hks9A) fix schoolboy error in cciss probe :-) --- xen/drivers/block/cciss.c | 49 ++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/xen/drivers/block/cciss.c b/xen/drivers/block/cciss.c index 6e7096c890..1cd341fa61 100644 --- a/xen/drivers/block/cciss.c +++ b/xen/drivers/block/cciss.c @@ -441,34 +441,41 @@ void cciss_probe_devices(xen_disk_info_t *xdi) drive_info_struct *drv; xen_disk_t *xd = &xdi->disks[xdi->count]; - ctlr = 0; /* XXX SMH: only deal with 1 controller for now */ - /* Loop through each real device */ - for(i=0; i < NWD; i++) { - - drv = &(hba[ctlr]->drv[i]); - - if (!(drv->nr_blocks)) - continue; - - if ( xdi->count == xdi->max ) - BUG(); - + for(ctlr = 0; ctlr < MAX_CTLR; ctlr++) { + + if(hba[ctlr] != NULL) { + + /* Loop through each real device */ + for(i=0; i < NWD; i++) { + + drv = &(hba[ctlr]->drv[i]); + + if (!(drv->nr_blocks)) + continue; + + if ( xdi->count == xdi->max ) + BUG(); - hba[ctlr]->hd[i << NWD_SHIFT].nr_sects = - hba[ctlr]->sizes[i << NWD_SHIFT] = drv->nr_blocks; - /* We export 'raw' linux device numbers to domain 0. */ - xd->device = MKDEV(hba[ctlr]->major, i << 4); - xd->info = XD_TYPE_DISK; /* XXX should check properly */ - xd->capacity = drv->nr_blocks; /* in terms of 512byte sectors */ - xd->domain = 0; + hba[ctlr]->hd[i << NWD_SHIFT].nr_sects = + hba[ctlr]->sizes[i << NWD_SHIFT] = drv->nr_blocks; - xdi->count++; - xd++; + /* We export 'raw' linux device numbers to domain 0. */ + xd->device = MKDEV(hba[ctlr]->major, i << 4); + xd->info = XD_TYPE_DISK; /* XXX should check properly */ + xd->capacity = drv->nr_blocks; /* number of 512 byte sectors */ + xd->domain = 0; + + xdi->count++; + xd++; + } + + } } + return; } /* -- 2.30.2